package com.blackhorse.bean;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

/**
 * SpringBoot自动装配依赖于ImportSelector接口
 */
public class UserImportSelector implements ImportSelector {
    @Override
    public String[] selectImports(AnnotationMetadata annotationMetadata) {
        //获取配置类名称，让Spring加载这个配置类，相当于在UserConfiguration上加@Configuration注解
        return new String[]{UserConfiguration.class.getName()};
    }
}
